

<!-- 购物车 -->
<template>
	<view>
		
		<!-- header部分 -->
		<view class='header-Container header-height' style="background-color: #FE5E49;">
			<!-- <image class="bg" :src="icon.headerBg" mode=""></image> -->
			<view class="leftBtns"></view>
			
			<view @click="togglePopup('bottom', 'popup')" class="title white">
				<view class="name">购物车</view>
				<image :src="icon.address"></image>
			</view>
			<view class="rightBtns">
				<view v-if="!editFlag" @click="editCartListHandler" class="edit">编辑</view>
				<view v-else @click="editCartListHandler" class="edit">完成</view>
				
				<view @click="gotoMsgCenter()" class="msgCenter-Container" >
					<image class="menu" style="width: 50upx;height: 50upx;margin-right: 40upx;" src="/static/images/index/message.png"></image>
					<view v-if="noticeTipCount || $store.state.msgNumber" class="msgCount">
						{{noticeTipCount + $store.state.msgNumber>99 ? '99+' : noticeTipCount + $store.state.msgNumber}}
					</view>
				</view>
			</view>
		</view>
		
		
		<!-- 购物车商品列表 -->
		<view>
			<view class="all-store" v-for="(item, index) of shopCartData" :key="index">
				<view class="store-title">
					<view class="title-block">
			
						<!-- 店铺是否选中 -->
						<image :src="icon.sel" class="checkbox" v-if="item.selectedTag == 1" @tap="select_store(index, 0, item.shopId)"></image>
						<image :src="icon.empty" class="checkbox" v-else @tap="select_store(index, 1, item.shopId)"></image>
			
<!--						<view class="ourself" v-if="item.selfSupport">自营</view>-->
						<image :src="icon.shop" class="shopIcon" v-else></image>
						<view class="store-name ellipsis1" @tap='toShop(item.shopId)'>
							{{ item.shopName }}
						</view>
						<!-- <image :src="icon.bindRight"></image> -->
					</view>
			
					<!-- 根据优惠是否为空判断优惠部分显示 -->
					<view class="count-block">
						<view v-if="item.shopCoupons" @click="showCouponModalHandler(item.shopId, index)" class="count-btn">
							优惠券
						</view>
					</view>
				</view>
				
				<!-- 凑单立减 -->
				<view class="discount" v-if="item.addOn">
					<view class="left">
						<view class="icon">凑单立减</view>
						<view class="discount-message">满{{item.full / 100}}元立减{{item.reduce / 100}}元</view>
					</view>
			
					<view @click="gotoShopPage(item.shopId)" class="right">
						<view>去凑单</view>
						<image :src="icon.redBind"></image>
					</view>
				</view>
			
				<!-- 当前店铺商品列表 -->
				<view @touchstart="touchstartHandler($event, item2.id)" @touchmove="touchmoveHandler($event, item2.id)" class="shopGoodsList" v-for="(item2, index2) of item.shopCartGoodsForms" :key="index2">
					<view class="goodsBaseInfo" :class="{showMoveGood: moveId == item2.id}" style="align-items: flex-start;">
						<view class="row-div">
							<image :src="icon.sel" class="checkbox" v-if="item2.selectedTag == 1" @tap="good_select(index, index2, 0)"></image>
							<image :src="icon.empty" class="checkbox" v-else @tap="good_select(index, index2, 1)"></image>
							<image @click="gotoDetail(item2.activityType, item2.goodsCd)" class="good-url" :src="imgSite + item2.coverPicture"></image>
						</view>
					
						<view class="good-detail">
							<view class="name ellipsis2" style="margin-bottom: 13upx;">
								<!-- 活动类型 2：秒杀活动 5：砍价 6：拼团预售 -->
								<text v-if="item2.activityType == 2" class="goodsLabel seckill">秒杀</text>
								<text v-if="item2.activityType == 5" class="goodsLabel bargain">砍价</text>
								<text v-if="item2.activityType == 6" class="goodsLabel preGroup">拼团预售</text>
								<text>{{ item2.goodName }}</text>
							</view>
							<view style="margin-bottom: 11upx;">
								<text class="size">{{ item2.goodsCategoryAttr }}</text>
							</view>
						
							<!-- 价格，积分，购买数量 -->
							<view class="row-between number" style="margin-bottom: 8upx;">
								<view style="font-size: 28upx;color: #333333;font-weight: bold;">¥{{ item2.salesPrice / 100 }}</view>
								<!-- 销售策略 10：现金 20：现金＋积分 40：积分 60:水券 70:水券 + 现金 -->
<!-- 								<view v-if="item2.salesStrategy == 10" class='price'>
									<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
									<text v-else>¥{{ item2.salesPrice / 100 }}</text>
								</view>
								<view v-if="item2.salesStrategy == 20" class='price'>
									<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
									<text v-else>¥{{ item2.salesPrice / 100 }}</text> -->
<!--									<text>+</text>-->
<!--									<text>{{ item2.salesPoint }}</text>-->
<!--									<text>积分</text>-->
								<!-- </view> -->
								<!-- <view v-if="item2.salesStrategy == 40" class='price'>
									<text>{{ item2.salesPoint }}</text>
									<text>积分</text>
								</view>
								<view v-if="item2.salesStrategy == 60" class='price'>
									<text>{{ item2.waterCoupon / 100 }}</text>
									<text>水券</text>
								</view>
								<view v-if="item2.salesStrategy == 70" class='price'>
									<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
									<text v-else>¥{{ item2.salesPrice / 100 }}</text>
									<text>+</text>
									<text>{{ item2.waterCoupon / 100 }}</text>
									<text>水券</text>
								</view>
								<view v-if="item2.salesStrategy == 100" class='price'>
									<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
									<text v-else>¥{{ item2.salesPrice / 100 }}</text>
								</view>
								 -->
								
								<!-- 操作数量 -->
								<view class="num">
									<view class="add">
										<image :src="icon.jia" @tap="addOne(index, index2)"></image>
									</view>
									<view class="txt">
										<input v-model="item2.num" type="number" @blur="updateGoodsCount(item2.id, item2.num, index, index2)" />
									</view>
									<view class="add">
										<image :src="icon.jian" @tap="minusOne(index, index2)"></image>
									</view>
								</view>
							</view>
							<view style="font-size: 22upx;color: #FE5E49;">可获{{item2.contribution}}贡献值</view>
						</view>
						
						
						<!-- 删除容器 -->
						<view v-if="moveId == item2.id" @click="deleteOneGood(item2.id)" class="touchRemoveBtn">
							删除
						</view>
					</view>
					
					<!-- 是否保税商品: 10-常规; 20-保税; -->
					<view class="bs-Container" v-if="item.type == 20" >
						<view v-if="item.type == 20" class="bs_goods">保税商品</view>
					</view>
					
					
					<!-- 赠品信息 -->
					<view v-if="item2.giftGoodList && item2.giftGoodList.length" class="gift">
						<view class="left">赠品</view>
						<view class="right-width">
							<view @click="gotoDetail('', item3.goodsCd)" class="right" v-for="item3 of item2.giftGoodList" :key="item3.id">
								<view class="g-name ellipsis1">{{ item3.goodsBaseInfo | giftGoodFormat}}</view>
								<view class="g-num">x{{ item3.giftCount }}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		
		<!-- 失效商品列表 -->
		<view v-if="invalidShopCartGoodsForms && invalidShopCartGoodsForms.length" class="all-store overdue-store">
			<view class="store-title">
				<view class="overdue-title">
					<view>失效商品</view>
				</view>
				<view class="overdue-clean">
					<view class="count-btn" @tap="clean()">清空</view>
				</view>
			</view>
			<view class="shopGoodsList invalidGoodsList" v-for="(item2, index2) of invalidShopCartGoodsForms" :key="item2.id">
				<view class="goodsBaseInfo">
					<view class="overdue">
						<view>失效</view>
					</view>
					<image class="good-url" :src="imgSite + item2.coverPicture"></image>
				
					<view class="good-detail">
						<view class="name ellipsis2">
							<text v-if="item2.activityType == 2" class="goodsLabel seckill">秒杀</text>
							<text v-if="item2.activityType == 5" class="goodsLabel bargain">砍价</text>
							<text v-if="item2.activityType == 6" class="goodsLabel preGroup">拼团预售</text>
							<text>{{ item2.goodName }}</text>
						</view>
						<view>
							<text class="size">{{ item2.goodsCategoryAttr }}</text>
						</view>
					
						<!-- 价格，积分，购买数量 -->
						<view class="number">
							
							<!-- 销售策略 10：现金 20：现金＋积分 40：积分 60:水券 70:水券 + 现金 -->
							<view v-if="item2.salesStrategy == 10" class='price'>
								<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
								<text v-else>¥{{ item2.salesPrice / 100 }}</text>
							</view>
							<view v-if="item2.salesStrategy == 20" class='price'>
								<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
								<text v-else>¥{{ item2.salesPrice / 100 }}</text>
<!--								<text>+</text>-->
<!--								<text>{{ item2.salesPoint }}</text>-->
<!--								<text>积分</text>-->
							</view>
<!--							<view v-if="item2.salesStrategy == 40" class='price'>-->
<!--								<text>{{ item2.salesPoint }}</text>-->
<!--								<text>积分</text>-->
<!--							</view>-->
<!--							<view v-if="item2.salesStrategy == 60" class='price'>-->
<!--								<text>{{ item2.waterCoupon / 100 }}</text>-->
<!--								<text>水券</text>-->
<!--							</view>-->
<!--							<view v-if="item2.salesStrategy == 70" class='price'>-->
<!--								<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>-->
<!--								<text v-else>¥{{ item2.salesPrice / 100 }}</text>-->
<!--								<text>+</text>-->
<!--								<text>{{ item2.waterCoupon / 100 }}</text>-->
<!--								<text>水券</text>-->
<!--							</view>-->
							<view v-if="item2.salesStrategy == 100" class='price'>
								<text v-if="getShowMemberFlag(item2)">¥{{ item2.memberPrice / 100 }}</text>
								<text v-else>¥{{ item2.salesPrice / 100 }}</text>
							</view>
							
							
							<!-- 失效原因 -->
							<view class="num">
								<view class="overdue-btn">{{ item2.invalidReason || "已失效"}}</view>
							</view>
						</view>
					</view>
				</view>
				
				<!-- 是否保税商品: 10-常规; 20-保税; -->
				<view class="bs-Container">
					<view v-if="item2.type == 20" class="bs_goods">保税商品</view>
				</view>
				
				
				<!-- 赠品信息 -->
				<view class="gift" style="display: none;">
					<view class="left">赠品</view>
					<view class="right-width">
						<view class="right" v-for="item3 of item2.gift" :key="item3.id">
							<view class="g-name ellipsis1">{{ item3.g_name }}</view>
							<view class="g-num">x{{ item3.g_num }}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		
		<!-- 暂无数据 -->
		<view v-if="(shopCartData && shopCartData.length) || (invalidShopCartGoodsForms && invalidShopCartGoodsForms.length)">
		</view>
		<view v-else>
			<g-empty></g-empty>
		</view>


		<!-- 底部总价，全选 -->
		<view class="bottom-total" :style="bottom">
			<view class="bottom-left">
				<image :src="icon.sel" v-if="allChecked" @tap="(allChecked = 0), select_all(allChecked)"></image>
				<image :src="icon.empty" v-else @tap="(allChecked = 1), select_all(allChecked)"></image>
				<view class="txt">全选</view>
				<view class="txt total">
					<text>总计 :</text>
					<text>¥{{ sumPrice / 100 }}</text>
				</view>
			</view>
			<view v-if="!editFlag" class="bottom-right">
				<view @click="gotoSubmitOrder" class="settlement">
					结算({{selectedTotal}})
				</view>
			</view>
			<view v-else class="bottom-right">
				<view @click="removeCartGoods" class="settlement">
					删除
				</view>
			</view>
		</view>


		<!-- 配送地址 -->
		<uni-popup ref="showpopup" :type="type">
			<view class="popup-content">
				<view class="title">
					配送至
					<image src="/static/images/common/closeModal.png" @click="close"></image>
				</view>
				<scroll-view scroll-y="true">
					<view class="address" v-for="(item,index) of addressList" :key="item.id" @click="addressSel = index; close();">
						<view class="left">
							<image v-if="addressSel == index" mode="widthFix" src="/static/images/common/select.png" class="select"></image>
							<image v-else mode="widthFix" src="/static/images/common/address.png" class="address_img"></image>
						</view>
						<view class="right ellipsis2">{{item.province}}{{item.city}}{{item.district}}{{item.address}}</view>
					</view>
					<!-- TODO -->
				</scroll-view>
				<view class="column-div" style="width: 100%;">
					<button class="add-btn" v-if="addressList.length==0" @click="addAddress('add',0)">新增地址</button>
					<button  class="add-btn" v-else @click="addAddress('add',0)">选择其他地址</button>
				</view>
				<!-- #ifdef H5 -->
				<view style="height: 160upx"></view>
				<!-- #endif -->
				
				<!-- #ifdef APP-PLUS -->
				<view style="height: 40upx"></view>
				<!-- #endif -->
			</view>
		</uni-popup>


		<!-- 商品列表弹窗 -->
		<view v-if="showShopGoodsGroupModal" class="bg-Container">
			<view class="goodsListModal-Container">

				<view class="title">
					请分开结算以下商品
				</view>

				<!-- 店铺商品分组 -->
				<scroll-view scroll-y="true" class="shopGoodsGroup-Container">

					<!-- 保税分组 -->
					<view v-for="(item, index) of shopCartDataSubmit" v-if="item.type == 20" class="oneGroup">
						<image :src="icon.sel" class="checkbox" v-if="shopGoodsGroupId == item.shopId && bondedWarehouse == item.bondedWarehouse" @click="shopGoodsGroupSelect(item.shopId, item.bondedWarehouse)"></image>
						<image :src="icon.empty" class="checkbox" v-else @click="shopGoodsGroupSelect(item.shopId, item.bondedWarehouse)"></image>
						
						<view class="shopGoodsInfo">
							<view class="shopName">
								{{item.shopName}}
							</view>
							<view class="goodsCount">
								<text v-if="item.shopCartGoodsForms.length == 1" class="oneFullName ellipsis1">
									{{item.shopCartGoodsForms[0].goodName}}
								</text>
								<block v-else>
									<text class="goodsNameList ellipsis1">
										{{item.shopCartGoodsForms[0].goodName}}
									</text>
									<text>
										等{{item.shopCartGoodsForms.length}}件商品
									</text>
								</block>
							</view>
						</view>
					</view>

					
					<!-- 常规分组 -->
					<view v-if="otherGoodsLength" class="oneGroup">
						<image :src="icon.sel" class="checkbox" v-if="shopGoodsGroupId == 'otherGoods'" @click="shopGoodsGroupSelect('otherGoods', '')"></image>
						<image :src="icon.empty" class="checkbox" v-else @click="shopGoodsGroupSelect('otherGoods', '')"></image>

						<view class="shopGoodsInfo">
							<view class="shopName">
								其他店铺
							</view>
							<view class="goodsCount">
								{{otherGoodsLength}}件商品
							</view>
						</view>
					</view>
				</scroll-view>

				
				<view class="btnsOuter-Container">
					<view @click="groupCartHandler()" class="cartBtn-Container">
						购物车
					</view>
					<view @click="groupSubmitHandler()" class="buyBtn-Container">
						去结算
					</view>
				</view>
			</view>
		</view>

		<!-- 优惠券弹窗 -->
		<couponModal page="cart" :showFlag="showCouponModal" :couponList="shopCouponList" @closeModalHandler="closeModalHandler"></couponModal>
	
		<!-- 详情菜单 -->
		<view v-if="showDetailMenu" @click="toggleMenuListHandler()" class="detailMenu-Container">
			<detailMenu></detailMenu>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	
	import detailMenu from "@/components/detailMenu/detailMenu";
	import couponModal from "@/components/couponModal/couponModal";

	export default {
		filters: {
			
			//赠品信息格式化
			giftGoodFormat(goodsBaseInfo) {
				var baseInfo = JSON.parse(goodsBaseInfo);
				return baseInfo['goodsName'];
			}
		},
		components: {
			detailMenu,
			couponModal
		},
		computed: {
			...mapState(['imgSite', 'hasLogin'])
		},
		data() {
			return {
				occupied: '80px',
				//详情菜单
				showDetailMenu: false,

				//购物车数据
				sumPrice: 0,
				selectedTotal: 0,
				shopCartData: [],
				invalidShopCartGoodsForms: [],
				noticeTipCount: 0,

				//编辑状态
				editFlag: false,
				moveId: "",
				startId: "",
				startX: 0,
				startY: 0,
				endId: "",
				endX: 0,
				endY: 0,
				

				//保税商品数据
				otherGoodsLength: 0,
				taxationFlag: false,
				showShopGoodsGroupModal: false,
				shopCartDataSubmit: [],
				shopGoodsGroupId: "",
				bondedWarehouse: "",


				//选择地址窗口
				type: 'bottom',
				showAddressModal: false,
				bottom: 'bottom:0rpx',
				icon: {
					headerBg: '/static/images/common/header.png',
					searchBtn: '/static/images/order/search.png',
					menuBtn_white: '/static/images/order/menu.png',

					shopIcon: '/static/images/order/shop.png',
					rightBtn: '/static/images/common/rightBtn.png',

					top: '/static/images/index/top.png',
					address: '/static/images/cart/address.png',
					msgCenter: '/static/images/common/msg-center-white.png',
					sel: '/static/images/cart/sel.png',
					empty: '/static/images/cart/empty.png',
					shop: '/static/images/cart/shop.png',
					bindRight: '/static/images/cart/bindRight.png',
					redBind: '/static/images/cart/redBind.png',
					jia: '/static/images/cart/jia.png',
					jian: '/static/images/cart/jian.png'
				},
				allChecked: false, //全选状态  true|false
				empty: false, //空白页现实  true|false

				addressList: [],
				addressSel: 0,

				//优惠券数据
				showCouponModal: false,
				shopCouponList: [],
				
				//分页相关
				pageNum: 1,
				pageSize: 10
			};
		},
		onLoad() {
			// #ifdef H5
			this.bottom = 'bottom:100rpx;';
			this.occupied = '80px';
			// #endif
			
			// #ifndef APP-PLUS
				this.occupied = '0px';
			// #endif
			if (!this.hasLogin) {
				uni.navigateTo({
					url: '/pagesUser/login/userLogin'
				});
			}
		},
		onShow() {
			
			this.showDetailMenu = false;
			this.editFlag = false;
			
			if(this.$refs['showpopup']) {
				this.$refs['showpopup'].close();
			}
			
			let that = this;
			
			if (this.hasLogin) {
				
				this.$api.globalUtil.requestAjax({
					url: '/CustomerApi/findCustomerAddressByCustomerIdForApi',
					method: 'POST',
					data: {},
					success: function(res) {
						that.addressList = res.data.response;
						for(var i = 0; i < that.addressList.length; i++) {
							var address = that.addressList[i];
							if(address.defaultFlag == 1) {
								that.addressSel = i;
								return ;
							}
						}
					}
				});
				
				//购物车列表
				this.getCartGoodsList();
				
				this.$api.globalUtil.requestAjax({
					url: '/customerNoticeApi/customerNoticeUnreadCountApi',
					method: 'POST',
					data: {
						cnType: "",
						cnStatus: '0'
					},
					success: function(res) {
						that.noticeTipCount = res.data.response;
					}
				});
				
				that.$api.globalUtil.setTabBarBadge();
			}
			
			
			//重置保税
			that.otherGoodsLength = 0;
			that.taxationFlag = false;
			that.showShopGoodsGroupModal = false;
			that.shopCartDataSubmit = [];
			that.shopGoodsGroupId = "";
			that.bondedWarehouse = "";
		},
		methods: {
			
			
			// 显示会员价逻辑
			getShowMemberFlag(item) {
				if(item.customerLevelId
					&& (item.salesStrategy == 10 || item.salesStrategy == 20 || item.salesStrategy == 70)
					&& (item.memberName && item.memberPrice)) {
						
					return true;
				}else {
					return false;
				}
			},
			
			
			//详情菜单
			toggleMenuListHandler() {
				this.showDetailMenu = !this.showDetailMenu;
			},
			toShop(id){
				uni.navigateTo({
					url: 'pagesGoods/shop/shopDetail?vendorId='+id
				})
			},
			
			
			// 地址弹框打开
			togglePopup(type, open) {
				this.type = type;
				this.$nextTick(() => {
					this.$refs['show' + open].open();
				});
			},
			// 地址弹框关闭
			close() {
				this.$refs['showpopup'].close();
			},
			// 店铺全选操作
			select_store(e, state, shopId) {

				var goodsIds = [];
				if (state === 0) {
					for (let item of this.shopCartData[e].shopCartGoodsForms) {
						item.selectedTag = false;
						goodsIds.push(item.id);
					}
					this.allChecked = false;
					this.shopCartData[e].selectedTag = false;
				} else {
					for (let item of this.shopCartData[e].shopCartGoodsForms) {
						item.selectedTag = true;
						goodsIds.push(item.id);
					}
					this.shopCartData[e].selectedTag = true;
					this.checkall();
				}
				
				//选中|取消购物车
				this.selectCancelGoods(goodsIds, state);
			},


			// 选择单个商品
			good_select(index, index2, type) {
				if (type === 1) {
					let tip = false;
					for (let item of this.shopCartData[index].shopCartGoodsForms) {
						if (!item.selectedTag) tip = true;
					}
					if (!tip) {
						// this.shopCartData[index].selectedTag = true;
						this.checkall();
					}
					this.shopCartData[index].shopCartGoodsForms[index2].selectedTag = true;
				} else {
					this.shopCartData[index].shopCartGoodsForms[index2].selectedTag = false;
					this.shopCartData[index].selectedTag = false;
					this.allChecked = false;
				}

				//选中/取消商品
				var goodsIds = [this.shopCartData[index].shopCartGoodsForms[index2].id];
				this.selectCancelGoods(goodsIds, type);
			},
			// 判断是否为全选状态
			checkall() {
				let tip = true;
				for (let item of this.shopCartData) {
					if (item.selectedTag == 0) tip = false;
				}
				if (tip) this.allChecked = true;
			},


			// 跳转新增地址
			addAddress(type, item) {

				let that = this;
				that.$api.globalUtil.methodFilter({
					that: that,
					success: function() {
						uni.navigateTo({
							url: `/pagesUser/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
						});
					}
				});
			},


			//编辑列表
			editCartListHandler() {
				this.editFlag = !this.editFlag;
			},


			//删除购物车
			removeCartGoods() {

				var that = this;
				if(that.selectedTotal) {
					uni.showModal({
						content: '确认删除选中的商品？',
						confirmText: '确认',
						cancelText: '取消',
						success(res) {
							if (res.confirm) {
					
								var ids = [];
								for (var i = 0; i < that.shopCartData.length; i++) {
									for (var j = 0; j < that.shopCartData[i].shopCartGoodsForms.length; j++) {
										var goods = that.shopCartData[i].shopCartGoodsForms[j];
										if (goods.selectedTag == 1) {
											console.log("执行了？");
											ids.push(goods.id);
										}
									}
								}
					
								that.removeGoodsApi(ids);
							}
						}
					});
				}else {
					this.$api.msg("请选择商品");
				}
			},


			// 清空失效商品
			clean() {

				var that = this;
				uni.showModal({
					content: '确认清空失效商品？',
					confirmText: '确认',
					cancelText: '取消',
					success(res) {
						if (res.confirm) {

							var ids = [];
							for (var i = 0; i < that.invalidShopCartGoodsForms.length; i++) {
								ids.push(that.invalidShopCartGoodsForms[i].id);
							}

							that.removeGoodsApi(ids);
						}
					}
				});
			},


			//删除商品接口
			removeGoodsApi(ids) {

				var that = this;
				that.$api.globalUtil.requestAjax({
					url: "/ShopCartApi/removeShopCartBatchForApi",
					method: "POST",
					data: {
						ids: ids.join(",") //购物车id
					},
					success: function(res) {
						if (res.data.success) {
							that.editFlag = false;
							that.getCartGoodsList();
							
							//左滑删除重置
							that.moveId = "";
							that.startId = "";
							that.startX = 0;
							that.startY = 0;
							that.endId = "";
							that.endX = 0;
							that.endY = 0;
						}
					}
				});
			},


			//购物车列表
			getCartGoodsList() {
				this.$api.showLoading()
				var addressId = "";
				if(this.addressList && this.addressList.length && this.addressSel) {
					addressId = this.addressList[this.addressSel].id;
				}

				var that = this;
				that.$api.globalUtil.requestAjax({
					url: "/ShopCartApi/getShopCartByCustomerIdForApi",
					method: "POST",
					data: {
						customerAddressId: ""
					},
					success: function(res) {
						if (res.data.success) {
							that.sumPrice = res.data.response.goodsOrderPaymentDto.amount;
							that.selectedTotal = res.data.response.selectedTotal;
							that.shopCartData = res.data.response.shopCartSplitForms || [];
							
							//失效商品
							that.invalidShopCartGoodsForms = res.data.response.invalidShopCartGoodsForms || [];

							//全选状态
							that.checkall();
							
							that.$api.globalUtil.setTabBarBadge();
						}
					},
					complate: () => this.$api.hideLoading()
				});
			},

			// 关闭弹窗
			closeModalHandler() {
				this.showCouponModal = false;
			},


			// 优惠券弹窗
			showCouponModalHandler(vendorId, index) {

				var that = this;
				var shopCartIds = [];
				for (var j = 0; j < that.shopCartData[index].shopCartGoodsForms.length; j++) {
					var goods = that.shopCartData[index].shopCartGoodsForms[j];
					// if (goods.selectedTag == 1) {
					// 	shopCartIds.push(goods.id);
					// }
					shopCartIds.push(goods.id);
				}
				
				that.shopCouponList = [];
				that.$api.globalUtil.requestAjax({
					url: "/coupon/getShopCouponList",
					method: "POST",
					data: {
						vendorId: vendorId,
						shopCartIds: shopCartIds.join(","),
						customerAddressId: ""
					},
					success: function(res) {
						if (res.data.success) {
							that.shopCouponList = res.data.response;
						}
					}
				});
				this.showCouponModal = !this.showCouponModal;
			},


			//选中/取消商品
			selectCancelGoods(goodsIds, type) {

				var that = this;
				that.$api.globalUtil.requestAjax({
					url: "/ShopCartApi/checkByShopCartIdsForApi",
					method: "POST",
					data: {
						shopCartIds: goodsIds.join(","), //商品Id，以,分割
						selectedTag: type //是否选中: 0-未选;1-选中
					},
					success: function(res) {
						if (res.data.success) {
							that.getCartGoodsList();
						}
					}
				});
			},


			//全选/取消商品
			select_all(type) {
				this.allSelectCancelGoods(type);
			},
			allSelectCancelGoods(type) {

				var that = this;
				that.$api.globalUtil.requestAjax({
					url: "/ShopCartApi/checkAllShopCartForApi",
					method: "POST",
					data: {
						selectedTag: type //是否选中: 0-未选;1-选中
					},
					success: function(res) {
						if (res.data.success) {
							that.getCartGoodsList();
						}
					}
				});
			},


			//数量增加
			addOne(index, index2) {
				var cartData = this.shopCartData[index].shopCartGoodsForms[index2];
				cartData.num = parseInt(cartData.num) + 1;
				this.addMinusGoodsCount(cartData.id, 0);
			},

			//数量减少
			minusOne(index, index2) {
				var cartData = this.shopCartData[index].shopCartGoodsForms[index2];
				if (parseInt(cartData.num) < 2) {
					this.$api.msg("最少购买1件");
					cartData.num = 1;
				}else {
					cartData.num = parseInt(cartData.num) - 1;
					this.addMinusGoodsCount(cartData.id, 1);
				}
			},


			// 加减商品数量
			addMinusGoodsCount(id, type) {

				var that = this;
				that.$api.globalUtil.requestAjax({
					url: "/ShopCartApi/shopCartCountEditForApi",
					method: "POST",
					data: {
						id: id, //购物车id
						type: type //增减标志（0 加， 1减）
					},
					success: function(res) {
						if (res.data.success) {
							that.getCartGoodsList();
						}
					}
				});
			},


			// 修改购物车数量
			updateGoodsCount(id, num, index, index2) {
				
				if(!num) {
					this.$api.msg("请输入购买数量!");
					return ;
				}else if(isNaN(num)) {
					this.$api.msg("购买数量必须是数字!");
					return ;
				}
				
				if(num < 1) {
					var cartData = this.shopCartData[index].shopCartGoodsForms[index2];
					cartData.num = 1;
					num = 1;
					this.$api.msg("最少购买1件");
				}
				

				var that = this;
				that.$api.globalUtil.requestAjax({
					url: "/ShopCartApi/updateShopCartCountForApi",
					method: "POST",
					data: {
						id: id, //购物车id
						num: num //商品购买数量
					},
					success: function(res) {
						if (res.data.success) {
							that.getCartGoodsList();
						}
					}
				});
			},


			//goto提交订单
			gotoSubmitOrder() {

				let that = this;

				//重置保税
				that.otherGoodsLength = 0;
				that.taxationFlag = false;
				that.showShopGoodsGroupModal = false;
				that.shopCartDataSubmit = [];
				that.shopGoodsGroupId = "";
				that.bondedWarehouse = "";

				//选中数量!=0
				if (this.selectedTotal) {

					//缓存购物车数据
					var shopCartDataSubmit = [];
					var shopCartDataStorage = JSON.parse(JSON.stringify(that.shopCartData));
					for (var i = 0; i < that.shopCartData.length; i++) {
						
						var shopTempData = [];
						for (var j = 0; j < that.shopCartData[i].shopCartGoodsForms.length; j++) {
							var goods = that.shopCartData[i].shopCartGoodsForms[j];
							if (goods.selectedTag == 1) {
								shopTempData.push(goods);

								//保税商品
								if (goods.bondedFlag) {
									that.taxationFlag = true;
								} else {
									that.otherGoodsLength += 1;
								}
							}
						}

						if (shopTempData.length) {
							shopCartDataStorage[i].shopCartGoodsForms = shopTempData;
							shopCartDataSubmit.push(shopCartDataStorage[i]);
						}
					}
					let contribution = 0; // 贡献值
					shopCartDataSubmit.forEach(i => i.shopCartGoodsForms.forEach(item => {
						contribution += item.contribution * item.num
					}))
					uni.setStorageSync('contribution', contribution);

					//是否包含保税商品
					if (that.taxationFlag) {

						var shopCartDataSubmitTemp = JSON.parse(JSON.stringify(shopCartDataSubmit));
						shopCartDataSubmit = [];
						for(var i = 0; i < shopCartDataSubmitTemp.length; i++) {
							
							// 购物车类型(10:常规，20:保税)
							if(shopCartDataSubmitTemp[i].type == 10) {
								shopCartDataSubmit.push(shopCartDataSubmitTemp[i]);
							}else {
							
								// 按[店铺-仓库]拆分
								for(var j = 0; j < shopCartDataSubmitTemp[i].shopCartGoodsForms.length; j++) {
									
									var goods = shopCartDataSubmitTemp[i].shopCartGoodsForms[j];
									
									var findIndex = findShopBondedWarehouseIndex(shopCartDataSubmit, shopCartDataSubmitTemp[i].shopId, goods.bondedWarehouse);
									if(findIndex == -1) {
										shopCartDataSubmit.push(JSON.parse(JSON.stringify(shopCartDataSubmitTemp[i])));
										shopCartDataSubmit[shopCartDataSubmit.length - 1].bondedWarehouse = goods.bondedWarehouse;
										shopCartDataSubmit[shopCartDataSubmit.length - 1].shopCartGoodsForms = [goods];
									}else {
										shopCartDataSubmit[findIndex].shopCartGoodsForms.push(goods);
									}
								}
							}
						}
						
						
						// 是否存在[店铺-仓库]
						function findShopBondedWarehouseIndex(shopCartDataSubmit, shopId, bondedWarehouse) {
							
							var index = -1;
							for(var i = 0; i < shopCartDataSubmit.length; i++) {
								if(shopCartDataSubmit[i].shopId == shopId && shopCartDataSubmit[i].bondedWarehouse == bondedWarehouse) {
									index = i;
									break;
								}
							}
							
							return index;
						}
						
						
						if(shopCartDataSubmit.length > 1) {
							that.shopCartDataSubmit = shopCartDataSubmit;
							that.showShopGoodsGroupModal = true;
						}else {
							uni.setStorageSync('addressData', JSON.stringify(that.addressList[that.addressSel]));
							uni.setStorageSync('shopCartData', JSON.stringify(shopCartDataSubmit));
							
							uni.navigateTo({
								url: '/pagesOrder/createOrder?taxationFlag=1&shopCartFlag=1'
							});
						}
					} else {
						uni.setStorageSync('addressData', JSON.stringify(that.addressList[that.addressSel]));
						uni.setStorageSync('shopCartData', JSON.stringify(shopCartDataSubmit));
						
						uni.navigateTo({
							url: '/pagesOrder/createOrder?taxationFlag=0&shopCartFlag=1'
						});
					}
				} else {
					this.$api.msg("请选择商品");
				}
			},


			//选择分组
			shopGoodsGroupSelect(shopId, bondedWarehouse) {
				
				if (this.shopGoodsGroupId == shopId && this.bondedWarehouse == bondedWarehouse) {
					this.shopGoodsGroupId = "";
					this.bondedWarehouse = "";
				} else {
					this.shopGoodsGroupId = shopId;
					this.bondedWarehouse = bondedWarehouse;
				}
			},


			//分组-购物车
			groupCartHandler() {
				
				var that = this;

				//重置保税
				that.otherGoodsLength = 0;
				that.taxationFlag = false;
				that.showShopGoodsGroupModal = false;
				that.shopCartDataSubmit = [];
				that.shopGoodsGroupId = "";
				that.bondedWarehouse = "";
			},

			
			//分组-去结算
			groupSubmitHandler() {

				var that = this;
				if (that.shopGoodsGroupId) {
					
					//缓存购物车数据
					var shopCartDataSubmit = [];
					var shopCartDataStorage = JSON.parse(JSON.stringify(that.shopCartDataSubmit));

					//其他店铺
					if (that.shopGoodsGroupId == "otherGoods") {
						
						for (var i = 0; i < that.shopCartDataSubmit.length; i++) {
							
							//购物车类型(10:常规，20:保税)
							if (that.shopCartDataSubmit[i].type == 10) {
								
								var shopTempData = [];
								for (var j = 0; j < that.shopCartDataSubmit[i].shopCartGoodsForms.length; j++) {
									var goods = that.shopCartDataSubmit[i].shopCartGoodsForms[j];
									shopTempData.push(goods);
								}
								
								shopCartDataSubmit.push(JSON.parse(JSON.stringify(shopCartDataStorage[i])));
								shopCartDataSubmit[shopCartDataSubmit.length - 1].shopCartGoodsForms = shopTempData;
							}
						}
						
						
						uni.setStorageSync('addressData', JSON.stringify(that.addressList[that.addressSel]));
						uni.setStorageSync('shopCartData', JSON.stringify(shopCartDataSubmit));
						
						uni.navigateTo({
							url: '/pagesOrder/createOrder?taxationFlag=0&shopCartFlag=1'
						});
					} else {

						for (var i = 0; i < that.shopCartDataSubmit.length; i++) {

							//购物车类型(10:常规，20:保税)
							if (that.shopCartDataSubmit[i].type == 20 && that.shopGoodsGroupId == that.shopCartDataSubmit[i].shopId && that.bondedWarehouse == that.shopCartDataSubmit[i].bondedWarehouse) {
								
								var shopTempData = [];
								for (var j = 0; j < that.shopCartDataSubmit[i].shopCartGoodsForms.length; j++) {
									var goods = that.shopCartDataSubmit[i].shopCartGoodsForms[j];
									shopTempData.push(goods);
								}
								
								shopCartDataSubmit.push(JSON.parse(JSON.stringify(shopCartDataStorage[i])));
								shopCartDataSubmit[shopCartDataSubmit.length - 1].shopCartGoodsForms = shopTempData;
							}
						}
						
						
						uni.setStorageSync('addressData', JSON.stringify(that.addressList[that.addressSel]));
						uni.setStorageSync('shopCartData', JSON.stringify(shopCartDataSubmit));
						
						uni.navigateTo({
							url: '/pagesOrder/createOrder?taxationFlag=1&shopCartFlag=1'
						});
					}
				} else {
					that.$api.msg("请选择结算商品");
				}
			},
			stopHandler() {
			}, 
			
			
			//商品详情
			gotoDetail(activityType, id) {
			
				// 2：秒杀活动 5：砍价 6：拼团预售
				if(activityType) {
					if(activityType == 2) {
						uni.navigateTo({
							url: '/pages/detail/seckill?id=' + id
						});
					}
					if(activityType == 5) {
						uni.navigateTo({
							url: '/pages/detail/bargain?id=' + id
						});
					}
					if(activityType == 6) {
						uni.navigateTo({
							url: '/pages/detail/preGroup?id=' + id
						});
					}
				}else {
					uni.navigateTo({
						url: '/pages/detail/detail?id=' + id
					});
				}
			},
			
			
			// 左滑删除
			touchstartHandler(e, id) {
				this.startId = id;
				this.startX = e.changedTouches[0].clientX;
				this.startY = e.changedTouches[0].clientY;
			},
			touchmoveHandler(e, id) {
				this.endId = id;
				this.endX = e.changedTouches[0].clientX;
				this.endY = e.changedTouches[0].clientY;
				
				if((this.endX - this.startX < -30) && (this.endId == this.startId)) {
					this.moveId = id
				}else {
					this.moveId = "";
				}
			},
			deleteOneGood(id) {
				
				var that = this;
				uni.showModal({
					content: '确认删除选中的商品？',
					confirmText: '确认',
					cancelText: '取消',
					success(res) {
						if (res.confirm) {
							var ids = [id];
							that.removeGoodsApi(ids);
						}
					}
				});
			},
			
			
			//去凑单
			gotoShopPage(vendorId) {
				uni.navigateTo({
					url: "/pagesGoods/shop/shopDetail?vendorId="+vendorId
				});
			},
			// goto消息中心
			gotoMsgCenter() {
				let that = this;
				that.$api.globalUtil.methodFilter({
					that: that,
					success: function() {
						uni.navigateTo({
							url: '/pagesUser/msgCenter'
						});
					}
				});
			},
		}
	};
</script>

<style lang="scss">
	page {
		background: #f5f5f5;
		// padding-top: 176rpx;
		padding-bottom: 100rpx;
		overflow-x: hidden;
	}
	
	// header部分
	.header-Container {
		width: 100%;
		height: 176rpx;
		overflow: hidden;
		// box-shadow: 0px 1rpx 1rpx 0px rgba(0, 0, 0, 0.08);
		background: rgba(255, 255, 255, 1);
		
		.bg {
			position: absolute;
			top: 0;
			margin: 0;
			width: 100%;
			
			/* #ifdef H5 */
			height: 88rpx !important;
			/* #endif */
			
			/* #ifdef APP-PLUS */
			height: calc(var(--status-bar-height) + 88rpx) !important;
			/* #endif */
			
			/* #ifdef MP-WEIXIN */
			height: calc(var(--status-bar-height) + 176rpx) !important;
			/* #endif */
		}
	
		.leftBtns {
			z-index: 9999;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			position: absolute;
			bottom: 0;
			height: 86rpx;
			
			.back {
				margin-left: 17rpx;
				width: 44rpx;
				height: 44rpx;
			}
		}
		
		.title {
			display: flex;
			justify-content: center;
			align-items: center;
			position: absolute;
			z-index: 99;
			bottom: 0;
			width: 100%;
			height: 88rpx;
			line-height: 88rpx;
			text-align: center;
			font-size: 36rpx;
			font-family: PingFang SC;
			background-color: rgba(0,0,0,0);
			&.white {
				color:rgba(255,255,255,1);
			}
			&.black {
				color: rgba(51, 51, 51, 1);
			}
			
			image {
				width: 26rpx;
				height: 32rpx;
				margin-left: 10rpx;
			}
		}
		
		.rightBtns {
			z-index: 9999;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			position: absolute;
			bottom: 0;
			right: 0;
			// width: 100%;
			height: 88rpx;
			
			.edit {
				font-size: 28rpx;
				font-family: PingFang SC;
				// font-weight: 500;
				color: rgba(255,255,255,1);
				margin-right: 56rpx;
			}
		}
			
		.search, .menu {
			width: 40rpx;
			height: 40rpx;
		}
		
		.search {
			margin-right: 40rpx;
		}
		.menu {
			margin-right: 46rpx;
		}
		
		.msgCount {
			position: absolute;
			bottom: 50rpx;
			right: 32rpx;
			min-width: 26rpx;
			width: auto;
			height:26rpx;
			line-height: 26rpx;
			text-align: center;
			font-size:20rpx;
			font-family:PingFang SC;
			font-weight:bold;
			color: #FE5E49;
			background:rgba(255,255,255,1);
			box-shadow:0px 1rpx 4rpx 0px rgba(68,68,68,0.2);
			border-radius:26rpx;
		}
		
		
		.msgCenter-Container {
			display: flex;
			align-items: center;
		}
	}

	//选中/取消
	.checkbox {
		height: 36rpx;
		width: 36rpx;
	}
	
	.shopIcon {
		margin-left: 20rpx;
		width: 28rpx;
		height: 27rpx;
	}

	.all-store {
		margin-bottom: 24rpx;
		position: relative;
		z-index: 2;
		background-color: #fff;
		border-radius: 20rpx;

		.discount {
			margin: 0 auto;
			width: 690rpx;
			height: 80rpx;
			display: flex;
			align-items: center;

			.left {
				width: 80%;
				display: flex;

				.icon {
					width:104rpx;
					height:30rpx;
					line-height: 30rpx;
					background:rgba(210,23,40,0.1);
					border-radius:15rpx;
					text-align: center;
					font-size:20rpx;
					font-family:PingFang SC;
					// font-weight:500;
					color:#FE5E49;
				}

				.discount-message {
					margin-left: 25rpx;
					font-size:22rpx;
					font-family:PingFang SC;
					// font-weight:500;
					color:rgba(102,102,102,1);
				}
			}

			.right {
				width: 100rpx;
				display: flex;
				align-items: center;
				justify-content: flex-end;
				margin-left: auto;
				font-size:22rpx;
				font-family:PingFang SC;
				// font-weight:500;
				color: #FE5E49;
			}

			image {
				width: 9rpx;
				height: 16rpx;
				margin-left: 15rpx;
			}
		}

		.store-title {
			margin: 0 auto;
			width: 100%;
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: left;
			font-size: 38rpx;
			border-bottom: 1rpx solid #eeeeee;
			padding: 0 30upx;
			.title-block {
				width: 85%;
				display: flex;
				align-items: center;
			}

			.count-block {
				margin-left: auto;
			}

			.count-btn {
				width: 90rpx;
				height: 32rpx;
				border-radius: 20rpx;
				font-size: 21rpx;
				border: 1rpx solid #FE5E49;
				text-align: center;
				color: #FE5E49;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			.ourself {
				background: #FE5E49;
				color: white;
				font-size: 20rpx;
				border-radius: 10upx;
				height: 30rpx;
				margin-left: 20rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				width: 60rpx;
			}

			.store-name {
				max-width: 420rpx;
				margin-left: 15rpx;
				font-size:28rpx;
				font-family:PingFang SC;
				// font-weight:500;
				color:rgba(51,51,51,1);
			}

			image:last-child {
				width: 11rpx;
				height: 18rpx;
				margin-left: 15rpx;
			}
		}

		// 商品列表
		.shopGoodsList {
			display: flex;
			flex-direction: column;
			align-items: center;
			position: relative;
			padding: 28rpx 0;
			overflow-x: hidden;
			border-bottom: 1px solid #EEEEEE;
			&:last-child{
				border: none;
			}
			.goodsBaseInfo {
				display: flex;
				align-items: center;
				position: relative;
				margin: 0 auto;
				padding: 0 30rpx;
				overflow: hidden;
			}

			.check {
				position: relative;
				bottom: 60rpx;
			}

			.good-url {
				height: 160rpx;
				width: 160rpx;
				margin-left: 26rpx;
			}

			.good-detail {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				// width: 420rpx;
				width: 430rpx;
				height: 100%;
				margin-left: 40rpx;

				.name {
					// height:60rpx;
					font-size:26rpx;
					font-family:PingFang SC;
					color:rgba(51,51,51,1);
					line-height:34rpx;
				}

				.size {
					padding: 0 24rpx;
					height:36rpx;
					line-height: 36rpx;
					background:rgba(245,245,245,1);
					border-radius:5rpx;
					font-size:22rpx;
					font-family:PingFang SC;
					// font-weight:500;
					color:rgba(102,102,102,1);
					line-height:40rpx;
				}

				.number {
					display: flex;
					height: 40rpx;
					align-items: center;

					.price {
						width: 50%;
						font-size: 30rpx;
						color: #e0122b;
					}

					.num {
						width: 50%;
						font-size: 23rpx;
						display: flex;
						flex-direction: row-reverse;
						align-items: center;
						height: 100%;

						image {
							height: 30rpx;
							width: 30rpx;
						}

						.overdue-btn {
							// width: max-content;
							width: 134rpx;
							height: 40rpx;
							font-size: 24rpx;
							background-color: rgba(0, 0, 0, 0.3);
							display: flex;
							justify-content: center;
							align-items: center;
							color: white;
							border-radius: 20rpx;
						}

						.add {
							display: flex;
							justify-content: center;
							align-items: center;
							width: 44rpx;
							height: 40rpx;
							border: 2rpx solid #eeeeee;
						}

						.txt {
							display: flex;
							justify-content: center;
							align-items: center;
							width: 80rpx;
							border-bottom: 2rpx solid #eeeeee;
							border-top: 2rpx solid #eeeeee;
							text-align: center;
							font-size: 20rpx;
							height: 40rpx;
							padding: 0;
							margin: 0;
						}
					}
				}
			}
		}

		// 保税商品
		.bs-Container {
			margin: 0 auto;
			margin-top: 20rpx;
			width: 690rpx;
			
			.bs_goods {
				margin-left: 62rpx;
				font-size: 20rpx;
				color: white;
				background: #FE5E49;
				width: 100rpx;
				height: 30rpx;
				text-align: center;
				border-radius: 15rpx;
			}
		}
		
		
		.gift {
			display: flex;
			width: 100%;
			margin-top: 30rpx;
			padding-left: 300rpx;
		
			.left {
				font-size:20rpx;
				font-family:PingFang SC;
				font-weight:bold;
				color:rgba(51,51,51,1);
				line-height:30rpx;
			}
		
			.right-width {
				width: 370rpx;
			}
		
			.right {
				margin-left: 14rpx;
				font-size: 20rpx;
				color: #666;
				width: 360rpx;
				display: flex;
		
				.g-name {
					width: 300rpx;
					overflow: hidden;
				}
		
				.g-num {
					width: 60rpx;
					text-align: right;
				}
			}
		}
		
		
		// 失效商品
		.overdue {
			position: relative;
			width: 54rpx;
			height: 26rpx;
			white-space: nowrap;
			display: flex;
			justify-content: center;

			view {
				width: 54rpx;
				height: 26rpx;
				font-size: 18rpx;
				background: rgba(0, 0, 0, 0.3);
				display: flex;
				justify-content: center;
				color: white;
				border-radius: 16rpx;
			}
		}
	}

	.bottom-total {
		position: fixed;
		z-index: 2;
		width: 100%;
		height: 98rpx;
		display: flex;
		align-items: center;
		padding: 0 0 0 30rpx;
		background-color: white;
		box-shadow:0px 0px 1rpx 0px rgba(68,68,68,0.48);

		.bottom-left {
			display: flex;
			width: 60%;
		}

		.bottom-right {
			display: flex;
			width: 40%;
			flex-direction: row-reverse;
		}

		image {
			width: 40rpx;
			height: 40rpx;
		}

		.txt {
			margin-left: 21rpx;
			font-size: 26rpx;
		}

		.total {
			margin-left: 36rpx;

			text:last-child {
				color: #FE5E49;
				margin-left: 26rpx;
			}
		}

		.settlement {
			font-size: 29rpx;
			background: #FE5E49;
			width: 210rpx;
			height: 98rpx;
			color: white;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}

	.overdue-store {
		margin-bottom: 100rpx;

		.overdue-title {
			width: 85%;
			display: flex;
			align-items: center;
			white-space: nowrap;
			overflow: hidden;

			view {
				margin-left: 30rpx;
				font-size: 26rpx;
			}
		}

		.overdue-clean {
			width: 15%;

			view {
				border: none;
			}
		}

		.overdue-message {
			height: 260rpx;

			.overdue-good-url {
				opacity: 0.3;
			}

			.overdue-goodname {
				font-size: 30rpx;
				color: #999999;
			}

			.overdue-size {
				color: #adadad;
			}

			.overdue-price {
				color: #999;
			}
		}
	}

	.popup-content {
		background-color: white;
		width: 100%;
		// padding-bottom: 200rpx;
		border-radius: 16rpx 16rpx 0 0;
		.title {
			padding-top: 50rpx;
			height: 119rpx;
			width: 100%;
			text-align: center;
			font-size: 30rpx;
			color: #333;
			font-weight: bold;
			position: relative;

			image {
				width: 25rpx;
				height: 24rpx;
				position: absolute;
				top: 36rpx;
				right: 36rpx;
			}
		}
		position: relative;
		scroll-view {
			height: 600upx;
			width: 100%;
			position: relative;
			.address {
				// height: 60rpx;
				width: 100%;
				display: flex;
				align-items: center;
				margin-top: 49rpx;

				.left {
					display: flex;
					align-items: center;
					width: 91rpx;
					padding-left: 50rpx;

					.select {
						width: 22rpx;
						margin-top: auto;
					}

					.address_img {
						width: 20rpx;
						margin-top: auto;
					}
				}

				.right {
					width: 659rpx;
					color: #666;
					font-size: 24rpx;
					padding-right: 70rpx;
					// display: flex;
					// align-items: center;
				}
			}
		}
	}

	.add-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 600rpx;
		height: 70rpx;
		font-size: 33rpx;
		color: #fff;
		background: #FE5E49;
		border-radius: 45rpx;
	}  


	// 商品列表弹窗
	.bg-Container {
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 99999;
		position: fixed;
		top: 0;
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, 0.7);

		.goodsListModal-Container {
			display: flex;
			flex-direction: column;
			justify-content: center;
			position: relative;
			width: 600rpx;
			min-height: 536rpx;
			height: auto;
			background: rgba(255, 255, 255, 1);
			border-radius: 16rpx;

			.title {
				// position: absolute;
				// top: 0;
				height: 130rpx;
				line-height: 130rpx;
				text-align: center;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: rgba(51, 51, 51, 1);
			}

			.shopGoodsGroup-Container {
				// display: flex;
				// flex-direction: column;
				// position: absolute;
				// top: 130rpx;
				margin: 0 auto;
				overflow-y: scroll;
				width: 500rpx;
				max-height: 360rpx;

				.oneGroup {
					display: flex;
					align-items: center;
					margin-bottom: 40rpx;


					.shopGoodsInfo {
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						position: relative;
						margin-left: 50rpx;

						.shopName {
							font-size: 26rpx;
							font-family: PingFang SC;
							color: rgba(51, 51, 51, 1);
							line-height: 40rpx;
						}

						.goodsCount {
							display: flex;
							flex-direction: row;
							align-items: center;
							font-size: 24rpx;
							font-family: PingFang SC;
							color: rgba(102, 102, 102, 1);
							line-height: 40rpx;
							
							.oneFullName {
								max-width: 360rpx;
							}
							.goodsNameList {
								max-width: 260rpx;
							}
						}
					}
				}
			}

			// 底部按钮
			.btnsOuter-Container {
				display: flex;
				align-items: center;
				justify-content: space-between;
				// position: absolute;
				// bottom: 0;
				padding: 0 68rpx;
				width: 100%;
				height: 166rpx;

				.cartBtn-Container {
					width: 210rpx;
					height: 70rpx;
					line-height: 70rpx;
					text-align: center;
					font-size: 30rpx;
					font-family: PingFang SC;
					color: #FE5E49;
					background: rgba(255, 255, 255, 1);
					border: 2rpx solid #FE5E49;
					border-radius: 35rpx;
				}

				.buyBtn-Container {
					width: 210rpx;
					height: 70rpx;
					line-height: 70rpx;
					text-align: center;
					font-size: 30rpx;
					font-family: PingFang SC;
					color: rgba(255, 255, 255, 1);
					background: #FE5E49;
					border-radius: 35px;
				}
			}
		}
	}
	
	
	//失效商品样式
	.invalidGoodsList {
		.good-url {
			margin-left: 8rpx !important; 
			opacity: 0.4;
		}
		.name {
			color: #999999 !important;
		}
		.size {
			color: #ADADAD !important;
		}
		.price {
			color: #999999 !important;
		}
	}
	
	
	// 删除操作
	.showMoveGood {
		position: relative;
		left: -130rpx;
	}
	.touchRemoveBtn {
		margin-left: 30rpx;
		width: 100rpx; 
		height: 160rpx;
		line-height: 160rpx;
		text-align: center;
		font-size: 29rpx;
		color: white;
		background-color: #e0122b;
	}
</style>




